package homework1;

import java.util.ArrayList;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Integer> numbers = new ArrayList<>();

        long startTime = System.currentTimeMillis();

        for (int i = 1; i <= 1000; i++) {
            numbers.add(i);
        }

        long endTime = System.currentTimeMillis();
        long executionTime = endTime - startTime;

        System.out.println("添加1至1000这1000个数字到集合中所花费的时间为：" + executionTime + "毫秒");
    }
}
